﻿using System;

using Ninject.Core;
using Ninject.Conditions;
using Ninject.Core.Behavior;
using Ninject.Core.Binding.Syntax;

using BlueSky.Web;

namespace BlueSky.Web.Extentions
{
    //public static class InlineModuleExt
    //{
    //    /// <summary>
    //    /// Bind controller service.
    //    /// </summary>
    //    /// <typeparam name="TIService">Type of service interface.</typeparam>
    //    /// <typeparam name="TService">Type of service class.</typeparam>
    //    /// <typeparam name="TController">Type of controller.</typeparam>
    //    /// <param name="module">Inlinemodule.</param>
    //    /// <returns>IBindingInlineArgumentSyntax</returns>
    //    public static IBindingInlineArgumentSyntax BindControllerService<TIService, TService, TController>(this InlineModule module)
    //        where
    //        TIService : IService
    //        where
    //        TService : TIService
    //        where
    //        TController : ControllerBase<TIService>
    //    {
    //        return module.BindControllerService<TIService, TService, TController>(true);
    //    }

    //    /// <summary>
    //    /// Bind controller service.
    //    /// </summary>
    //    /// <typeparam name="TIService">Type of service interface.</typeparam>
    //    /// <typeparam name="TService">Type of service class.</typeparam>
    //    /// <typeparam name="TController">Type of controller.</typeparam>
    //    /// <param name="module">Inlinemodule.</param>
    //    /// <param name="singletonBehavior">SingletonBehavior flag.</param>
    //    /// <returns>IBindingInlineArgumentSyntax</returns>
    //    public static IBindingInlineArgumentSyntax BindControllerService<TIService, TService, TController>(this InlineModule module, bool singletonBehavior)
    //        where
    //        TIService : IService
    //        where
    //        TService : TIService
    //        where
    //        TController : ControllerBase<TIService>
    //    {
    //        if (singletonBehavior)
    //            return module.Bind<TIService>().To<TService>().Only(When.Context.AsController<TController>()).Using<SingletonBehavior>();
    //        else
    //            return module.Bind<TIService>().To<TService>().Only(When.Context.AsController<TController>());
    //    }
    //}
}
